package com.example.communitypro.controller;


import com.example.communitypro.pojo.UserBrowseHistory;
import com.example.communitypro.service.UserBrowseHistoryService;
import com.example.communitypro.util.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping("/userBrowseHistory")
public class UserBrowseHistoryController {
    @Autowired
    private UserBrowseHistoryService userBrowseHistoryService;
    @ResponseBody
    @RequestMapping(value = "/addUserBrowseHistory")
    @CrossOrigin
    public Result addUserBrowseHistory(UserBrowseHistory record){
        return userBrowseHistoryService.addUserBrowseHistory(record);
    }
    @ResponseBody
    @RequestMapping(value = "/dropUserBrowseHistory")
    @CrossOrigin
    public Result dropUserBrowseHistory(Integer browse_record_no){
        return userBrowseHistoryService.dropUserBrowseHistory(browse_record_no);
    }

    @ResponseBody
    @RequestMapping(value = "/modifyUserBrowseHistory")
    @CrossOrigin
    public Result modifyUserBrowseHistory(UserBrowseHistory record){
        return userBrowseHistoryService.modifyUserBrowseHistory(record);
    }

    @ResponseBody
    @RequestMapping(value = "/queryUserBrowseHistory")
    @CrossOrigin
    public Result queryUserBrowseHistory(Integer browse_record_no){
        return userBrowseHistoryService.queryUserBrowseHistory(browse_record_no);
    }

    @ResponseBody
    @RequestMapping(value = "/queryHistoryByUser")
    @CrossOrigin
    public Result queryHistoryByUser(Integer userNo){
        return userBrowseHistoryService.queryByUser(userNo);
    }

    @ResponseBody
    @RequestMapping(value = "/dropHistoryByUserNo")
    @CrossOrigin
    public Result dropHistoryByUserNo(Integer userNo){
        return userBrowseHistoryService.dropByUser(userNo);
    }
}
